﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class doanh_nghiep_DNAdminLayout : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Session["IDDoanhNghiep"] != null) // da dang nhap
            {
                // hien thi ten dang nhap
                lblUsername.Text = Session["TenDangNhap"].ToString();
            }
            else
            {
                Response.Redirect("login.aspx");
            }
        }
    }
    protected void lbtnDangXuat_Click(object sender, EventArgs e)
    {
        /*
        Response.Cookies["LanTruyCapCuoi"].Expires = DateTime.Now.AddDays(-1);
        Response.Cookies["TenDangNhap"].Expires = DateTime.Now.AddDays(-1);
        Response.Cookies["IDDoanhNghiep"].Expires = DateTime.Now.AddDays(-1);*/

        Session["IDDoanhNghiep"] = null;
        Session["LanTruyCapCuoi"] = null;
        Session["TenDangNhap"] = null;

        Response.Redirect("login.aspx");
    }
}
